#include<iostream>
#include<string>
#include<thread>
#include<memory>

class Obj {
public:
    int val;
public:
    Obj (int _val): val(_val) {
        std::cout<< "[构造]" <<std::endl;
    }
    Obj (const Obj& t): val(t.val) {
        std::cout<< "[copy构造]" <<std::endl;
    }
    ~Obj() {
        std::cout<< "[析构]" <<std::endl;
    }
};

void myThread (std::shared_ptr<Obj> t) {
    std::cout<< "thread start" << std::endl;
    std::cout<< "thread end" << std::endl;
}

int main() {
    std::shared_ptr<Obj> myobj(new Obj(101));
    std::thread thread_1(myThread, myobj);
    thread_1.join();
    std::cout<< "I love China" << std::endl;
    return 0;
}